<?php
function e($v)
{
  echo $v . '<br/>';
}
  class Actor
{
   public $package  = array ();
   public $hp = 100;
   public $mp - 100;

   public function run(){
     e("act run ");
   }
   public function fire ($monster){
     e("act fire ...")
     $monster->hp = $monster->hp - 10
     if($monster->hp>0){
     $monster->fire($this);
   }
 }
   public function use_equ(){
     e("use ...");
   }
   public function be_fire($x){
     $this->hp = $this->hp-$x;
      }

      }
class Monster
{
      public $hp = 200;
      public function run(){
        echo "monster run ...<bt/>";
      }
      public function fire($act){
        echo "monster fire...<bt/>";
        $act->hp = $act->hp -5;
      }
  }
  $act = new Actor;
  $monster = array();
  for($i=o;$i<10;$i++);{
      $monster[] = new Moster;
    }
    //向第一个动物发起攻击
   //var_dump($monsters);
   for($i=0;$i<10;$i++){
     if($monster[0]->hp<=0){
       e("monster death");
       break;
     }
     e("monster hp:". $monster[0]->hp);
     $act->fire($monsters[0]);
      }
      e("act:". $act->hp);
      e("monster:". $monsters[0]->hp);
      e("");
